package com.mac.hosp_pre.admin.entity;

import cn.hutool.json.JSONUtil;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.List;

/**
 * RegisterRule
 *
 * @author mac
 */
@Data
@Document("PreBookRule")
public class PreBookRule implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 预约周期
	 */
	private Integer cycle;

	/**
	 * 放号时间
	 */
	private String releaseTime;

	/**
	 * 停挂时间
	 */
	private String stopTime;

	/**
	 * 退号截止天数（如：就诊前一天为-1，当天为0）
	 */
	private Integer quitDay;

	/**
	 * 退号时间
	 */
	private String quitTime;

	/**
	 * 预约规则
	 */
	private List<String> rule;


	public void setRule(String rule) {
		if(!StringUtils.isEmpty(rule)) {
			this.rule = JSONUtil.toList(rule, String.class);
		}
	}

}

